package en.ameen.preciousengine;

/*!
An event packet is a concept I really liked from my experience with the 
Simple Direct Library (SDL). For each event that occurs, the engine would 
capture it and will add it in a special queue just made for events. Then you 
as a programmer you could just extract events from the queue and handle them 
the way you want. This class would normally hold the important information 
of a single event like: Touch Events and Key Events which are the common in 
mobile phones.
*/
public class EventPacket {

	/*!
	 Enumeration for the events that may occur 	  
	 */
	public enum EVENT_TYPE{
		
		TOUCH /*!< Touch Event. */ 
		
	}
	
	/*!
	   Enumeration for the actions of all the events that may occur
	 */
	public enum EVENT_ACTION{
		
		DOWNTOUCH,	/*!< Touch Down action, happens when the user touches the screen */ 
		UPTOUCH,	/*!< Touch Up action, happens when the user lifts his finger of the screen */ 
		MOVETOUCH	/*!< Touch Move action, happens when the user moves his finger through the screen */ 
		
	}
	
	//! Variable to hold the the type of the event
	public EVENT_TYPE type;
	
	//! Variable to hold the the action of the event
	public EVENT_ACTION action;
	
	//! Variable to hold the position of event on the x-axis if it was a touch event
	public int position_x;
	
	//! Variable to hold the position of event on the y-axis if it was a touch event
	public int position_y;
	
	
    //! Function the would fill the packet with the necessary information
    /*!
  
      \param touch Event Type
      \param downtouch Event Action
      \param x the position of the event on the x-axis
      \param y the position of the event on the y-axis

    */
	public void fillPacket(EVENT_TYPE touch, EVENT_ACTION downtouch, int x, int y){
	
		this.type = touch;
		this.action = downtouch;
		this.position_x = x;
		this.position_y = y;
		
	}

}
